//
//  TripViewController.swift
//  驻外机组
//
//  Created by 苏伟 on 16/4/6.
//  Copyright © 2016年 com.csair. All rights reserved.
//

import UIKit

class TripViewController: UIViewController,UIImagePickerControllerDelegate,UINavigationControllerDelegate, UIScrollViewDelegate {
    
    
    @IBOutlet weak var ButtonCityName: UIButton!
    @IBOutlet weak var CityImage: UIImageView!
    @IBOutlet weak var ButtonOne: UIButton!
    @IBOutlet weak var ButtonTwo: UIButton!
    @IBOutlet weak var ButtonThree: UIButton!
    @IBOutlet weak var ButtonFour: UIButton!
    @IBOutlet weak var ButtonFive: UIButton!
    @IBOutlet weak var ButtonSix: UIButton!
    //testssss
    @IBAction func homebtnclick(sender: AnyObject) {
        self.navigationController?.popViewControllerAnimated(true)
        var test:String = ""

    }
    //默认城市，此处待议
    var aa:String = "北京"
    
    override func viewDidLoad() {
        super.viewDidLoad()
        //图片按钮初始化
        //configureButtons()
        // Do any additional setup after loading the view.
    }
    
    
    override func viewDidAppear(animated: Bool) {
        configureButtons()
    }
    
    
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    //城市切换
    @IBAction func ChangeCity(sender: AnyObject) {
        let viewController = Common.rootViewController
        viewController.homeViewController.performSegueWithIdentifier("showCityList", sender: self)
        viewController.mainTabBarController.tabBar.hidden = true
    }
    
    //设置button背景图片
    func configureButtons(){
        ButtonOne.setBackgroundImage(UIImage(named: "基本资料"), forState: UIControlState.Normal)
        ButtonTwo.setBackgroundImage(UIImage(named: "机场服务"), forState: UIControlState.Normal)
        ButtonThree.setBackgroundImage(UIImage(named: "交通"), forState: UIControlState.Normal)
        ButtonFour.setBackgroundImage(UIImage(named: "宾馆"), forState: UIControlState.Normal)
        ButtonFive.setBackgroundImage(UIImage(named: "海关"), forState: UIControlState.Normal)
        ButtonSix.setBackgroundImage(UIImage(named: "攻略"), forState: UIControlState.Normal)
        CityImage.image = UIImage(named: aa)
        ButtonCityName.setTitle(aa, forState: UIControlState.Normal)
        
    }
    
    //MARK: table
    func configureNewsTable() {
        //        self.bigHeaderImageView.image = UIImage(named: cityName)
        //
        //        self.tableHeaderView = self.newsTableView.tableHeaderView!
        //        self.newsTableView.tableHeaderView = nil
        //        self.newsTableView.addSubview(self.tableHeaderView)
        //        self.newsTableView.sendSubviewToBack(self.tableHeaderView)
        //
        //        self.newsTableView.contentInset = UIEdgeInsetsMake(kTableHeightHeader, 0, 0, 0)
        //        self.newsTableView.contentOffset = CGPoint(x: 0, y: -kTableHeightHeader)
        
    }
    
    
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if segue.identifier == "showCityList" {
            if let a = segue.destinationViewController as? CityListViewController {
                
            }
        }
        
        if segue.identifier == "showHotelView" {
            if let a = segue.destinationViewController as? HotelViewController {
                a.navigationItem.title = "酒店信息"
            }
        }

        
        
    }

    
    
    /*
    // MARK: - Navigation
    
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    // Get the new view controller using segue.destinationViewController.
    // Pass the selected object to the new view controller.
    }
    */
    
}
